<?php

class ExportController extends BaseController {
	
	public function exportSales(){
		
		// filename for download
		$filename = "baliwag-sales-report" . date("mdyHis");
		
		header("Pragma: public");
		header("Expires: 0");
		header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
		header("Content-Type: application/force-download");
		header("Content-Type: application/octet-stream");
		header("Content-Type: application/download");
		header("Content-Disposition: attachment;filename=".$filename.".xls");
		header("Content-Transfer-Encoding: binary ");
		
		echo strip_tags($_POST['tableData'],'<table><th><tr><td>');
		
	}
	
	public function exportComplaints(){
	
		// filename for download
		$filename = "baliwag-complaints-report" . date("mdyHis");
	
		header("Pragma: public");
		header("Expires: 0");
		header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
		header("Content-Type: application/force-download");
		header("Content-Type: application/octet-stream");
		header("Content-Type: application/download");
		header("Content-Disposition: attachment;filename=".$filename.".xls");
		header("Content-Transfer-Encoding: binary ");
	
		echo strip_tags($_POST['tableData'],'<table><th><tr><td>');
	
	}
	
	public function exportInventory(){
	
		// filename for download
		$filename = "baliwag-inventory-report" . date("mdyHis");
	
		header("Pragma: public");
		header("Expires: 0");
		header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
		header("Content-Type: application/force-download");
		header("Content-Type: application/octet-stream");
		header("Content-Type: application/download");
		header("Content-Disposition: attachment;filename=".$filename.".xls");
		header("Content-Transfer-Encoding: binary ");
	
		echo strip_tags($_POST['tableData'],'<table><th><tr><td>');
	
	}
		
}